import { IncomingMessage, ServerResponse } from "http";
import url from 'url';
import path from 'path';

/** 查看模块源码路径 */
export const see = async (req: IncomingMessage, res: ServerResponse) => {
    const parsedUrl = url.parse(req.url || '', true);
    const { id } = parsedUrl.query as { id: string };

    const filePath = path.join(__dirname, '../../../../src/capabilityHooks', id, 'index.tsx')
    console.info('-------- 能力路径 --------');
    console.info(filePath);

    res.statusCode = 200;
    res.end();
}